/**
 * 检测数据库连接是否正常
 * npx ts-node src/index.ts
 * */
import AppDataSource from '../ormconfig';
import { User } from './user/user.entity';

AppDataSource.initialize()
  .then(async () => {
    const res = await AppDataSource.manager.find(User);

    console.log('数据库连接正常，查询结果为：', res);
  })
  .catch((error) => console.log(error));
